import { API_CONFIG } from "../config/index.js"
import  request from "../api/index.js"


export const getAssetsAllList = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getAssetsListApi,{},"POST",2000)
}
export const delAssetsHandler = (id) =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.delAssetsListApi,{id},"POST",2000)
}

export const addAssetsHandler = (data) =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.addAssetsListApi,data,"POST",2000)
}

// 获取对应资产的硬件配置信息
export const getAssetHardConfigInfoHandler = (assetId) =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getAssetHardConfigInfoApi,{assetId},"POST",2000)
}

// 保存对应硬件配置信息
export const saveAssetHardConfigInfoHandler = (data) =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.saveAssetHardConfigInfoApi,data,"POST",2000)
}

//查询资产分类信息表
export const getAssetCategoryInfoHandler = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getAssetCategoryInfoApi,{},"GET",2000)
}

//删除资产分类信息
export const delAssetCategoryInfoHandler = (id) =>{
    return request(API_CONFIG.delAssetCategoryInfoApi(id),{},"DELETE",2000)
}
// 添加资产分类
export const addAssetCategoryInfoHandler = (data) =>{
    return request(API_CONFIG.addAssetCategoryInfoApi,data,"POST",2000)
}

// 修改资产分类
export const updateAssetCategoryInfoHandler = (id,data) =>{
    return request(API_CONFIG.updateAssetCategoryInfoApi(id),data,"PUT",2000)
}

